#include "common.h"

PUBLIC S4B MemorySet(PVOID start,U4B size,U1B content)
{
   S4B i;
   __asm__ __volatile__(
           "movl %%eax,%%edx\n\t"
           "addl %%eax,%%ecx\n\t"
           "subl $1,%%ecx\n\t"
           "0:   \n\t"
           "cmpl %%ecx,%%eax\n\t"
           "ja 	 1f\n\t"
           "movb %%bl,(%%eax)\n\t"
           "addl $1,%%eax\n\t"
           "jmp  0b\n\t"              
           "1:   \n\t"
           "subl %%edx,%%eax\n\t"
           "movl %%eax,%%edx\n\t"
           "addl $1,%%edx\n\t"           
           :"=d"(i)
           :"a"(start),"b"(content),"c"(size)
           :"memory");
   return i;
}
